#include "Prop.h"

void Weapon::show()
{
    std::cout << "武器名：" << GetName()
              << "  价格：" << GetPrice()
              << "  攻击力 + " << GetAttack()
              << " " << std::endl;
}

PropPtr Weapon::clone()
{
    return std::make_shared<Weapon>(this->GetName(), this->GetPrice(), this->GetAttack(),this->GetcritChance(),this->GetdodgeChance(),this->Getattribute());
}

void Potion::show()
{
    std::cout << "药品: " << GetName() << ", 回复量: " << HealAmount << std::endl;
}

PropPtr Potion::clone()
{
    return std::make_shared<Potion>(this->GetName(), this->GetPrice(), this->GetHealAmount(),this->Getattribute());
}

void Armor::show()
{
    std::cout << "防具: " << GetName() << ", 防御力: " << Defense
              << ", 闪避率: " << dodgeChance << std::endl;
}

PropPtr Armor::clone()
{
    return std::make_shared<Armor>(this->GetName(), this->GetPrice(), this->GetDefense(),this->GetdodgeChance(),this->Getattribute());
}

void Diamond::show()
{
    std::cout << "钻石:" << GetName() 
              << "  金币 + " <<GetPrice() 
              << " " << std::endl;
}

PropPtr Diamond::clone()
{
    return std::make_shared<Diamond>(this->GetName(), this->GetPrice(),this->Getattribute());
}